package com.example.myproject.client;

import java.util.ArrayList;

import com.google.gwt.user.client.Window;

public class Layouts {
	
	HabitatLayout minLayout = new HabitatLayout();
	HabitatLayout optimal1 = new HabitatLayout();
	HabitatLayout optimal2 = new HabitatLayout();
	HabitatLayout optimal3 = new HabitatLayout();
	HabitatLayout optimal4 = new HabitatLayout();	
	
	 // Variables for minimum layout
	static boolean minBuilt = false;
	static boolean plain1 = false;
	static boolean plain2 = false;
	static boolean plain3 = false;
	static boolean dorm = false;
	static boolean airlock = false;
	static boolean control = false;
	static boolean power = false;
	static boolean food = false;
	static boolean canteen = false;
	static boolean sani = false;
	ArrayList<Module> minList = new ArrayList<Module>();
	
	public boolean addToMinimalLayout(Module mod) {
		String type = mod.getType();
		if (minBuilt) {
			return true;			
		} else if (type == "Medical" || type == "Gym & Relaxation") {
			return false;
		} else if (type == "Plain") {
			if (plain1) {
				if (plain2) {
					if (plain3) {
						return false;
					} else {
						if (mod.getStatus().equals("undamaged")) {
							plain3 = true;
							minList.add(mod);
						}
					}
				} else {
					if (mod.getStatus().equals("undamaged")) {
						plain2 = true;
						minList.add(mod);
					}
				}
			} else {
				if (mod.getStatus().equals("undamaged")) {
					plain1 = true;
					minList.add(mod);
				}
			}
		} else if (type == "Dormitory") {
			if (!dorm) {
				if (mod.getStatus().equals("undamaged")) {
					dorm = true;
					minList.add(mod);
				}
			}
		} else if (type == "Airlock") {
			if (!airlock) {
				if (mod.getStatus().equals("undamaged")) {
					airlock = true;
					minList.add(mod);
				}
			}
		} else if (type == "Control") {
			if (!control) {
				if (mod.getStatus().equals("undamaged")) {
					control = true;
					minList.add(mod);
				}
			}
		} else if (type == "Power") {
			if (!power) {
				if (mod.getStatus().equals("undamaged")) {
					power = true;
					minList.add(mod);
				}
			}
		} else if (type == "Storage") {
			if (!food) {
				if (mod.getStatus().equals("undamaged")) {
					food = true;
					minList.add(mod);
				}
			}
		} else if (type == "Canteen") {
			if (!canteen) {
				if (mod.getStatus().equals("undamaged")) {
					canteen = true;
					minList.add(mod);
				}
			}
		} else if (type == "Sanitation") {
			if (!sani) {
				if (mod.getStatus().equals("undamaged")) {
					sani = true;
					minList.add(mod);
				}
			}
		}		
			
		// after module type is checked, check if all modules are in already.
		if (plain1 && plain2 && plain3 && dorm && airlock && control && power && food && canteen && sani) {
				minBuilt = true;
				minLayout.addModuleList(minList);
				Sounds.playMinimumLayout();
				Window.alert("Minimum Layout Available");
				return true;
		} else {
				return false;
		}
	}
	
		// TODO(Sprint 2): find "center of gravity", check that habitat doesn't go over edges/sandy, set 'center', set all others around it.
		// TODO(Sprint 2): layout has to be based on +/-, +/- from 'center'

	Layouts() {			
		// Minimal Layout
		minLayout.addPlanType(50, 25, "Plain");
		minLayout.addPlanType(49, 25, "Plain");
		minLayout.addPlanType(51, 25, "Plain");
		minLayout.addPlanType(49, 24, "Dormitory");
		minLayout.addPlanType(52, 25, "Airlock");
		minLayout.addPlanType(49, 26, "Control");
		minLayout.addPlanType(50, 24, "Power");
		minLayout.addPlanType(51, 26, "Storage");
		minLayout.addPlanType(50, 26, "Canteen");
		minLayout.addPlanType(48, 25, "Sanitation");
		
		optimal1.addPlanType(50, 25, "Plain");
		optimal1.addPlanType(50, 26, "Storage");
		optimal1.addPlanType(50, 27, "Canteen");
		optimal1.addPlanType(50, 28, "Storage");
		optimal1.addPlanType(50, 29, "Power");
		optimal1.addPlanType(51, 25, "Plain");
		optimal1.addPlanType(51, 24, "Storage");
		optimal1.addPlanType(51, 23, "Storage");
		optimal1.addPlanType(51, 22, "Canteen");
		optimal1.addPlanType(51, 21, "Storage");
		optimal1.addPlanType(52, 29, "Dormitory");
		optimal1.addPlanType(52, 28, "Dormitory");
		optimal1.addPlanType(52, 27, "Sanitation");
		optimal1.addPlanType(52, 26, "Dormitory");
		optimal1.addPlanType(52, 25, "Plain");
		optimal1.addPlanType(52, 24, "Plain");
		optimal1.addPlanType(52, 23, "Plain");
		optimal1.addPlanType(52, 22, "Plain");
		optimal1.addPlanType(52, 21, "Plain");
		optimal1.addPlanType(52, 20, "Airlock");
		optimal1.addPlanType(53, 30, "Sanitation");
		optimal1.addPlanType(53, 29, "Plain");
		optimal1.addPlanType(53, 28, "Plain");
		optimal1.addPlanType(53, 27, "Plain");
		optimal1.addPlanType(53, 26, "Plain");
		optimal1.addPlanType(53, 25, "Plain");
		optimal1.addPlanType(53, 24, "Gym");
		optimal1.addPlanType(53, 23, "Storage");
		optimal1.addPlanType(53, 22, "Canteen");
		optimal1.addPlanType(53, 21, "Storage");
		optimal1.addPlanType(54, 29, "Dormitory");
		optimal1.addPlanType(54, 28, "Dormitory");
		optimal1.addPlanType(54, 27, "Sanitation");
		optimal1.addPlanType(54, 26, "Dormitory");
		optimal1.addPlanType(54, 25, "Plain");
		optimal1.addPlanType(55, 25, "Plain");
		optimal1.addPlanType(55, 24, "Control");
		optimal1.addPlanType(56, 24, "Gym");
		optimal1.addPlanType(56, 25, "Plain");
		optimal1.addPlanType(56, 26, "Storage");
		optimal1.addPlanType(57, 24, "Power");
		optimal1.addPlanType(57, 25, "Plain");
		optimal1.addPlanType(57, 26, "Canteen");
		optimal1.addPlanType(58, 24, "Medical");
		optimal1.addPlanType(58, 25, "Plain");
		optimal1.addPlanType(58, 26, "Storage");
		optimal1.addPlanType(59, 25, "Airlock");
		optimal1.addPlanType(49, 30, "Airlock");
		optimal1.addPlanType(49, 29, "Plain");
		optimal1.addPlanType(49, 28, "Plain");
		optimal1.addPlanType(49, 27, "Plain");
		optimal1.addPlanType(49, 26, "Plain");
		optimal1.addPlanType(49, 25, "Plain");
		optimal1.addPlanType(49, 24, "Dormitory");
		optimal1.addPlanType(49, 23, "Sanitation");
		optimal1.addPlanType(49, 22, "Dormitory");
		optimal1.addPlanType(49, 21, "Dormitory");
		optimal1.addPlanType(48, 29, "Medical");
		optimal1.addPlanType(48, 28, "Storage");
		optimal1.addPlanType(48, 27, "Control");
		optimal1.addPlanType(48, 26, "Gym");
		optimal1.addPlanType(48, 25, "Plain");
		optimal1.addPlanType(48, 24, "Plain");
		optimal1.addPlanType(48, 23, "Plain");
		optimal1.addPlanType(48, 22, "Plain");
		optimal1.addPlanType(48, 21, "Plain");
		optimal1.addPlanType(48, 20, "Sanitation");
		optimal1.addPlanType(47, 25, "Plain");
		optimal1.addPlanType(47, 24, "Dormitory");
		optimal1.addPlanType(47, 23, "Sanitation");
		optimal1.addPlanType(47, 22, "Dormitory");
		optimal1.addPlanType(47, 21, "Dormitory");
		optimal1.addPlanType(46, 26, "Medical");
		optimal1.addPlanType(46, 25, "Plain");
		optimal1.addPlanType(45, 25, "Plain");
		optimal1.addPlanType(45, 24, "Control");
		optimal1.addPlanType(44, 29, "Dormitory");
		optimal1.addPlanType(44, 28, "Dormitory");
		optimal1.addPlanType(44, 27, "Sanitation");
		optimal1.addPlanType(44, 26, "Dormitory");
		optimal1.addPlanType(44, 25, "Plain");
		optimal1.addPlanType(44, 24, "Power");
		optimal1.addPlanType(43, 30, "Sanitation");
		optimal1.addPlanType(43, 29, "Plain");
		optimal1.addPlanType(43, 28, "Plain");
		optimal1.addPlanType(43, 27, "Plain");
		optimal1.addPlanType(43, 26, "Plain");
		optimal1.addPlanType(43, 25, "Plain");
		optimal1.addPlanType(43, 24, "Medical");
		optimal1.addPlanType(42, 29, "Dormitory");
		optimal1.addPlanType(42, 28, "Dormitory");
		optimal1.addPlanType(42, 27, "Sanitation");
		optimal1.addPlanType(42, 26, "Dormitory");
		optimal1.addPlanType(42, 25, "Plain");
		optimal1.addPlanType(42, 24, "Power");
		optimal1.addPlanType(41, 25, "Plain");
		optimal1.addPlanType(41, 24, "Control");
		optimal1.addPlanType(40, 26, "Dormitory");
		optimal1.addPlanType(40, 25, "Plain");
		optimal1.addPlanType(40, 24, "Dormitory");
		optimal1.addPlanType(39, 26, "Sanitation");
		optimal1.addPlanType(39, 25, "Plain");
		optimal1.addPlanType(39, 24, "Gym");
		optimal1.addPlanType(38, 25, "Airlock");

		optimal2.addPlanType(50, 25, "Plain");
		optimal2.addPlanType(51, 25, "Plain");
		optimal2.addPlanType(51, 24, "Power");
		optimal2.addPlanType(51, 23, "Control");
		optimal2.addPlanType(51, 22, "Storage");
		optimal2.addPlanType(51, 21, "Storage");
		optimal2.addPlanType(51, 20, "Canteen");
		optimal2.addPlanType(52, 26, "Medical");
		optimal2.addPlanType(52, 25, "Plain");
		optimal2.addPlanType(52, 24, "Plain");
		optimal2.addPlanType(52, 23, "Plain");
		optimal2.addPlanType(52, 22, "Plain");
		optimal2.addPlanType(52, 21, "Plain");
		optimal2.addPlanType(52, 20, "Plain");
		optimal2.addPlanType(52, 19, "Airlock");
		optimal2.addPlanType(53, 25, "Plain");
		optimal2.addPlanType(53, 24, "Medical");
		optimal2.addPlanType(53, 23, "Storage");
		optimal2.addPlanType(53, 22, "Storage");
		optimal2.addPlanType(53, 21, "Storage");
		optimal2.addPlanType(53, 20, "Canteen");
		optimal2.addPlanType(54, 25, "Plain");
		optimal2.addPlanType(55, 32, "Gym");
		optimal2.addPlanType(55, 31, "Sanitation");
		optimal2.addPlanType(55, 30, "Dormitory");
		optimal2.addPlanType(55, 29, "Dormitory");
		optimal2.addPlanType(55, 28, "Dormitory");
		optimal2.addPlanType(55, 27, "Sanitation");
		optimal2.addPlanType(55, 26, "Dormitory");
		optimal2.addPlanType(55, 25, "Plain");
		optimal2.addPlanType(55, 24, "Dormitory");
		optimal2.addPlanType(56, 33, "Control");
		optimal2.addPlanType(56, 32, "Plain");
		optimal2.addPlanType(56, 31, "Plain");
		optimal2.addPlanType(56, 30, "Plain");
		optimal2.addPlanType(56, 29, "Plain");
		optimal2.addPlanType(56, 28, "Plain");
		optimal2.addPlanType(56, 27, "Plain");
		optimal2.addPlanType(56, 26, "Plain");
		optimal2.addPlanType(56, 25, "Plain");
		optimal2.addPlanType(56, 24, "Sanitation");
		optimal2.addPlanType(57, 32, "Dormitory");
		optimal2.addPlanType(57, 31, "Dormitory");
		optimal2.addPlanType(57, 30, "Gym");
		optimal2.addPlanType(57, 29, "Sanitation");
		optimal2.addPlanType(57, 28, "Dormitory");
		optimal2.addPlanType(57, 27, "Sanitation");
		optimal2.addPlanType(57, 26, "Dormitory");
		optimal2.addPlanType(57, 25, "Plain");
		optimal2.addPlanType(57, 24, "Dormitory");
		optimal2.addPlanType(58, 25, "Plain");
		optimal2.addPlanType(59, 25, "Airlock");
		optimal2.addPlanType(49, 30, "Canteen");
		optimal2.addPlanType(49, 29, "Storage");
		optimal2.addPlanType(49, 28, "Storage");
		optimal2.addPlanType(49, 27, "Storage");
		optimal2.addPlanType(49, 26, "Power");
		optimal2.addPlanType(49, 25, "Plain");
		optimal2.addPlanType(49, 24, "Dormitory");
		optimal2.addPlanType(48, 31, "Airlock");
		optimal2.addPlanType(48, 30, "Plain");
		optimal2.addPlanType(48, 29, "Plain");
		optimal2.addPlanType(48, 28, "Plain");
		optimal2.addPlanType(48, 27, "Plain");
		optimal2.addPlanType(48, 26, "Plain");
		optimal2.addPlanType(48, 25, "Plain");
		optimal2.addPlanType(48, 24, "Sanitation");
		optimal2.addPlanType(47, 30, "Canteen");
		optimal2.addPlanType(47, 29, "Storage");
		optimal2.addPlanType(47, 28, "Storage");
		optimal2.addPlanType(47, 27, "Control");
		optimal2.addPlanType(47, 26, "Medical");
		optimal2.addPlanType(47, 25, "Plain");
		optimal2.addPlanType(47, 24, "Dormitory");
		optimal2.addPlanType(46, 25, "Plain");
		optimal2.addPlanType(45, 26, "Power");
		optimal2.addPlanType(45, 25, "Plain");
		optimal2.addPlanType(45, 24, "Dormitory");
		optimal2.addPlanType(45, 23, "Sanitation");
		optimal2.addPlanType(45, 22, "Dormitory");
		optimal2.addPlanType(45, 21, "Dormitory");
		optimal2.addPlanType(45, 20, "Dormitory");
		optimal2.addPlanType(45, 19, "Sanitation");
		optimal2.addPlanType(45, 18, "Gym");
		optimal2.addPlanType(44, 26, "Control");
		optimal2.addPlanType(44, 25, "Plain");
		optimal2.addPlanType(44, 24, "Plain");
		optimal2.addPlanType(44, 23, "Plain");
		optimal2.addPlanType(44, 22, "Plain");
		optimal2.addPlanType(44, 21, "Plain");
		optimal2.addPlanType(44, 20, "Plain");
		optimal2.addPlanType(44, 19, "Plain");
		optimal2.addPlanType(44, 18, "Plain");
		optimal2.addPlanType(44, 17, "Power");
		optimal2.addPlanType(43, 26, "Medical");
		optimal2.addPlanType(43, 25, "Plain");
		optimal2.addPlanType(43, 24, "Sanitation");
		optimal2.addPlanType(43, 23, "Dormitory");
		optimal2.addPlanType(43, 22, "Dormitory");
		optimal2.addPlanType(43, 21, "Sanitation");
		optimal2.addPlanType(43, 20, "Gym");
		optimal2.addPlanType(43, 19, "Dormitory");
		optimal2.addPlanType(43, 18, "Dormitory");
		optimal2.addPlanType(42, 25, "Airlock");

		optimal3.addPlanType(50, 25, "Plain");
		optimal3.addPlanType(50, 26, "Canteen");
		optimal3.addPlanType(51, 26, "Storage");
		optimal3.addPlanType(51, 25, "Plain");
		optimal3.addPlanType(52, 26, "Storage");
		optimal3.addPlanType(52, 25, "Plain");
		optimal3.addPlanType(52, 24, "Medical");
		optimal3.addPlanType(53, 26, "Airlock");
		optimal3.addPlanType(53, 25, "Plain");
		optimal3.addPlanType(54, 26, "Control");
		optimal3.addPlanType(54, 25, "Plain");
		optimal3.addPlanType(55, 26, "Power");
		optimal3.addPlanType(55, 25, "Plain");
		optimal3.addPlanType(56, 25, "Plain");
		optimal3.addPlanType(57, 25, "Plain");
		optimal3.addPlanType(57, 24, "Control");
		optimal3.addPlanType(58, 26, "Medical");
		optimal3.addPlanType(58, 25, "Plain");
		optimal3.addPlanType(58, 24, "Power");
		optimal3.addPlanType(59, 26, "Gym");
		optimal3.addPlanType(59, 25, "Plain");
		optimal3.addPlanType(59, 24, "Gym");
		optimal3.addPlanType(60, 33, "Dormitory");
		optimal3.addPlanType(60, 32, "Dormitory");
		optimal3.addPlanType(60, 31, "Dormitory");
		optimal3.addPlanType(60, 30, "Sanitation");
		optimal3.addPlanType(60, 29, "Dormitory");
		optimal3.addPlanType(60, 28, "Dormitory");
		optimal3.addPlanType(60, 27, "Gym");
		optimal3.addPlanType(60, 26, "Sanitation");
		optimal3.addPlanType(60, 25, "Plain");
		optimal3.addPlanType(60, 24, "Sanitation");
		optimal3.addPlanType(60, 23, "Gym");
		optimal3.addPlanType(60, 22, "Dormitory");
		optimal3.addPlanType(60, 21, "Dormitory");
		optimal3.addPlanType(60, 20, "Sanitation");
		optimal3.addPlanType(60, 19, "Dormitory");
		optimal3.addPlanType(60, 18, "Dormitory");
		optimal3.addPlanType(60, 17, "Dormitory");
		optimal3.addPlanType(61, 34, "Sanitation");
		optimal3.addPlanType(61, 33, "Plain");
		optimal3.addPlanType(61, 32, "Plain");
		optimal3.addPlanType(61, 31, "Plain");
		optimal3.addPlanType(61, 30, "Plain");
		optimal3.addPlanType(61, 29, "Plain");
		optimal3.addPlanType(61, 28, "Plain");
		optimal3.addPlanType(61, 27, "Plain");
		optimal3.addPlanType(61, 26, "Plain");
		optimal3.addPlanType(61, 25, "Plain");
		optimal3.addPlanType(61, 24, "Plain");
		optimal3.addPlanType(61, 23, "Plain");
		optimal3.addPlanType(61, 22, "Plain");
		optimal3.addPlanType(61, 21, "Plain");
		optimal3.addPlanType(61, 20, "Plain");
		optimal3.addPlanType(61, 19, "Plain");
		optimal3.addPlanType(61, 18, "Plain");
		optimal3.addPlanType(61, 17, "Plain");
		optimal3.addPlanType(61, 16, "Sanitation");
		optimal3.addPlanType(62, 33, "Dormitory");
		optimal3.addPlanType(62, 32, "Dormitory");
		optimal3.addPlanType(62, 31, "Sanitation");
		optimal3.addPlanType(62, 30, "Dormitory");
		optimal3.addPlanType(62, 29, "Sanitation");
		optimal3.addPlanType(62, 28, "Dormitory");
		optimal3.addPlanType(62, 27, "Dormitory");
		optimal3.addPlanType(62, 25, "Airlock");
		optimal3.addPlanType(62, 23, "Dormitory");
		optimal3.addPlanType(62, 22, "Dormitory");
		optimal3.addPlanType(62, 21, "Sanitation");
		optimal3.addPlanType(62, 20, "Dormitory");
		optimal3.addPlanType(62, 19, "Sanitation");
		optimal3.addPlanType(62, 18, "Dormitory");
		optimal3.addPlanType(62, 17, "Dormitory");
		optimal3.addPlanType(49, 26, "Storage");
		optimal3.addPlanType(49, 25, "Plain");
		optimal3.addPlanType(48, 26, "Storage");
		optimal3.addPlanType(48, 25, "Plain");
		optimal3.addPlanType(48, 24, "Power");
		optimal3.addPlanType(47, 26, "Canteen");
		optimal3.addPlanType(47, 25, "Plain");
		optimal3.addPlanType(47, 24, "Control");
		optimal3.addPlanType(46, 26, "Storage");
		optimal3.addPlanType(46, 25, "Plain");
		optimal3.addPlanType(46, 24, "Medical");
		optimal3.addPlanType(45, 26, "Storage");
		optimal3.addPlanType(45, 25, "Plain");
		optimal3.addPlanType(45, 24, "Airlock");
		optimal3.addPlanType(44, 26, "Canteen");
		optimal3.addPlanType(44, 25, "Plain");
		optimal3.addPlanType(43, 26, "Storage");
		optimal3.addPlanType(43, 25, "Plain");
		optimal3.addPlanType(42, 26, "Storage");
		optimal3.addPlanType(42, 25, "Plain");
		optimal3.addPlanType(41, 26, "Canteen");
		optimal3.addPlanType(41, 25, "Plain");
		optimal3.addPlanType(40, 26, "Storage");
		optimal3.addPlanType(40, 25, "Plain");
		optimal3.addPlanType(39, 26, "Storage");
		optimal3.addPlanType(39, 25, "Plain");
		optimal3.addPlanType(39, 24, "Power");
		optimal3.addPlanType(38, 26, "Medical");
		optimal3.addPlanType(38, 25, "Plain");
		optimal3.addPlanType(38, 24, "Control");
		optimal3.addPlanType(37, 25, "Airlock");

		optimal4.addPlanType(50, 25, "Plain");
		optimal4.addPlanType(50, 26, "Airlock");
		optimal4.addPlanType(50, 24, "Power");
		optimal4.addPlanType(51, 26, "Medical");
		optimal4.addPlanType(51, 25, "Plain");
		optimal4.addPlanType(51, 24, "Gym");
		optimal4.addPlanType(52, 26, "Dormitory");
		optimal4.addPlanType(52, 25, "Plain");
		optimal4.addPlanType(52, 24, "Sanitation");
		optimal4.addPlanType(53, 26, "Sanitation");
		optimal4.addPlanType(53, 25, "Plain");
		optimal4.addPlanType(53, 24, "Dormitory");
		optimal4.addPlanType(54, 26, "Dormitory");
		optimal4.addPlanType(54, 25, "Plain");
		optimal4.addPlanType(54, 24, "Dormitory");
		optimal4.addPlanType(55, 26, "Dormitory");
		optimal4.addPlanType(55, 25, "Plain");
		optimal4.addPlanType(55, 24, "Sanitation");
		optimal4.addPlanType(56, 26, "Gym");
		optimal4.addPlanType(56, 25, "Plain");
		optimal4.addPlanType(56, 24, "Dormitory");
		optimal4.addPlanType(57, 26, "Sanitation");
		optimal4.addPlanType(57, 25, "Plain");
		optimal4.addPlanType(57, 24, "Dormitory");
		optimal4.addPlanType(58, 26, "Dormitory");
		optimal4.addPlanType(58, 25, "Plain");
		optimal4.addPlanType(58, 24, "Sanitation");
		optimal4.addPlanType(59, 26, "Dormitory");
		optimal4.addPlanType(59, 25, "Plain");
		optimal4.addPlanType(59, 24, "Dormitory");
		optimal4.addPlanType(60, 25, "Plain");
		optimal4.addPlanType(61, 25, "Airlock");
		optimal4.addPlanType(49, 26, "Control");
		optimal4.addPlanType(49, 25, "Plain");
		optimal4.addPlanType(49, 24, "Canteen");
		optimal4.addPlanType(48, 26, "Storage");
		optimal4.addPlanType(48, 25, "Plain");
		optimal4.addPlanType(48, 24, "Storage");
		optimal4.addPlanType(47, 26, "Canteen");
		optimal4.addPlanType(47, 25, "Plain");
		optimal4.addPlanType(47, 24, "Storage");
		optimal4.addPlanType(46, 26, "Storage");
		optimal4.addPlanType(46, 25, "Plain");
		optimal4.addPlanType(46, 24, "Storage");
		optimal4.addPlanType(45, 26, "Power");
		optimal4.addPlanType(45, 25, "Plain");
		optimal4.addPlanType(45, 24, "Control");
		optimal4.addPlanType(44, 26, "Medical");
		optimal4.addPlanType(44, 25, "Plain");
		optimal4.addPlanType(43, 25, "Plain");
		optimal4.addPlanType(42, 34, "Sanitation");
		optimal4.addPlanType(42, 33, "Dormitory");
		optimal4.addPlanType(42, 32, "Sanitation");
		optimal4.addPlanType(42, 31, "Gym");
		optimal4.addPlanType(42, 30, "Sanitation");
		optimal4.addPlanType(42, 29, "Dormitory");
		optimal4.addPlanType(42, 28, "Dormitory");
		optimal4.addPlanType(42, 27, "Sanitation");
		optimal4.addPlanType(42, 26, "Gym");
		optimal4.addPlanType(42, 25, "Plain");
		optimal4.addPlanType(42, 24, "Storage");
		optimal4.addPlanType(42, 23, "Storage");
		optimal4.addPlanType(42, 22, "Canteen");
		optimal4.addPlanType(42, 21, "Storage");
		optimal4.addPlanType(42, 20, "Medical");
		optimal4.addPlanType(42, 19, "Control");
		optimal4.addPlanType(41, 35, "Power");
		optimal4.addPlanType(41, 34, "Plain");
		optimal4.addPlanType(41, 33, "Plain");
		optimal4.addPlanType(41, 32, "Plain");
		optimal4.addPlanType(41, 31, "Plain");
		optimal4.addPlanType(41, 30, "Plain");
		optimal4.addPlanType(41, 29, "Plain");
		optimal4.addPlanType(41, 28, "Plain");
		optimal4.addPlanType(41, 27, "Plain");
		optimal4.addPlanType(41, 26, "Plain");
		optimal4.addPlanType(41, 25, "Plain");
		optimal4.addPlanType(41, 24, "Plain");
		optimal4.addPlanType(41, 23, "Plain");
		optimal4.addPlanType(41, 22, "Plain");
		optimal4.addPlanType(41, 21, "Plain");
		optimal4.addPlanType(41, 20, "Plain");
		optimal4.addPlanType(41, 19, "Plain");
		optimal4.addPlanType(41, 18, "Plain");
		optimal4.addPlanType(41, 17, "Plain");
		optimal4.addPlanType(41, 16, "Airlock");
		optimal4.addPlanType(40, 34, "Medical");
		optimal4.addPlanType(40, 33, "Dormitory");
		optimal4.addPlanType(40, 32, "Dormitory");
		optimal4.addPlanType(40, 31, "Dormitory");
		optimal4.addPlanType(40, 30, "Dormitory");
		optimal4.addPlanType(40, 29, "Dormitory");
		optimal4.addPlanType(40, 28, "Sanitation");
		optimal4.addPlanType(40, 27, "Dormitory");
		optimal4.addPlanType(40, 26, "Dormitory");
		optimal4.addPlanType(40, 25, "Plain");
		optimal4.addPlanType(40, 24, "Storage");
		optimal4.addPlanType(40, 23, "Canteen");
		optimal4.addPlanType(40, 22, "Storage");
		optimal4.addPlanType(40, 21, "Control");
		optimal4.addPlanType(40, 20, "Power");
		optimal4.addPlanType(39, 25, "Plain");
		optimal4.addPlanType(38, 25, "Plain");
		optimal4.addPlanType(37, 25, "Airlock");		
	}		
}
